package com.shardingsphere.shardingsphere.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shardingsphere.shardingsphere.dao.UserMapper;
import com.shardingsphere.shardingsphere.domain.User;
import com.shardingsphere.shardingsphere.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User>  implements UserService {

	@Override
	public boolean save(User entity) {
		return super.save(entity);
	}

	@Override
	public List<User> getUserList() {
		QueryWrapper<User> wrapper = new QueryWrapper();
		wrapper.lambda().getSqlSelect();
		wrapper.orderByAsc("id");
		wrapper.eq(true,"id",1);
		return baseMapper.selectList(wrapper);
	}
}
